package com.cloud.freeflow.api.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import com.cloud.freeflow.api.entity.ProcDef;
import com.cloud.freeflow.common.utils.BaseMapperHelper;

public interface ProcDefMapper extends BaseMapperHelper<ProcDef> {

	@Select("select count(*) from proc_def where proc_def_name = #{procDefName} and biz_id = #{bizId} "
			+ "and proc_def_id <> #{procDefId}")
	@ResultType(value = Long.class)
	long checkProcNameExitsUpdate(@Param("procDefName") String procDefName, @Param("bizId") long bizCode,
			@Param("procDefId") long procDefId);

	@Select("select count(*) from proc_def where proc_def_name = #{procDefName} and biz_id = #{bizId}")
	@ResultType(value = Long.class)
	long checkProcNameExitsCreate(@Param("procDefName") String procDefName, @Param("bizId") long bizCode);
}